//
//  AdvertisingPageViewAttachmentDescCell.swift
//  iModern
//
//  Created by 赵友源 on 15/9/6.
//  Copyright (c) 2015年 com.starlooking. All rights reserved.
//

import Foundation

import UIKit

class AdvertisingPageViewAttachmentDescCell: TableViewCell
{
    @IBOutlet var textView: UITextView!
    
    override func awakeFromNib()
    {
        super.awakeFromNib()
        // Initialization code
    }
    
    override func setSelected(selected: Bool, animated: Bool)
    {
        super.setSelected(selected, animated: animated)
        
        // Configure the view for the selected state
    }
    
    func setData(data: String)
    {
        let desc = data
        
        let paragraphStyle = NSMutableParagraphStyle()
        
        paragraphStyle.lineHeightMultiple = 16
        paragraphStyle.maximumLineHeight = 20
        paragraphStyle.minimumLineHeight = 20
        
        paragraphStyle.alignment = .Left
        
        let attributes = [NSFontAttributeName: UIFont.systemFontOfSize(14),
            NSParagraphStyleAttributeName: paragraphStyle,
            NSForegroundColorAttributeName: UIColor.darkGrayColor()]
        textView.attributedText = NSAttributedString(string: desc as String, attributes: attributes)
    }
}